package com.homework.test3;

import java.util.Scanner;

public class Demo5 {
    public static int max2(int x,int y){
        if (x>y){
            return x;
        }else {
            return y;
        }
    }
    public static int max3(int x,int y,int z){
        int max2 = max2(max2(x, y), z);
        return max2;
    }

    public static void main(String[] args) {

        int[] arr = new int[3];
        for (int i = 0; i < arr.length; i++) {
            System.out.println("请输入第一个数");
            arr[i] = new Scanner(System.in).nextInt();
        }
        int arrMax = max3(arr[0], arr[1], arr[2]);
        System.out.println("最大值为： " + arrMax);
    }
}
